/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.utfpr.dao;

import javax.persistence.EntityManager;
import pojo.Venda;

public class DaoVenda {

    public DaoVenda() {
    }

    public Venda salvar(Venda venda) {
        EntityManager entityManager = Conexao.getInstance().createEntityManager();

        entityManager.getTransaction().begin();

        venda = entityManager.merge(venda);

        entityManager.getTransaction().commit();

        entityManager.close();

        return venda;
    }
}
